﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace ServiceLayer
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IRepository
    {
        //Car

        [OperationContract]
        List<CarDTO> ReadAllCars();

        [OperationContract]
        CarDTO ReadCarById(int id);

        [OperationContract]
        CarDTO CreateCar();

        [OperationContract]
        void RemoveCar(int id);

        [OperationContract]
        List<CarDriverDTO> GetCarDrivers(int carId);

        [OperationContract]
        void SetCarDriver(int carId, int driverId, DateTime from, DateTime to);

        [OperationContract]
        void RemoveCarDriversBefore(int carId, DateTime time);

        [OperationContract]
        void SaveCar(CarDTO car);

        [OperationContract]
        CarStateDTO GetCurrentState(int carId);

        [OperationContract]
        DriverDTO GetCurrentDriver(int carId);

        [OperationContract]
        bool IsCarInPark(int carId);

        //CarState
        [OperationContract]
        List<CarStateDTO> ReadAllCarStates(int carId);

        [OperationContract]
        void RemoveCarStates(int carId, DateTime time);

        [OperationContract]
        void RemoveAllCarStates(int carId);

        [OperationContract]
        void RemoveCarStatesOfAllCars(DateTime time);

        //Driver
        [OperationContract]
        List<DriverDTO> ReadAllDrivers();

        [OperationContract]
        DriverDTO ReadDriverById(int id);

        [OperationContract]
        DriverDTO CreateDriver();

        [OperationContract]
        void RemoveDriver(int id);

        [OperationContract]
        void SaveDriver(DriverDTO driver);

        //Park
        [OperationContract]
        List<ParkDTO> ReadAllParks();

        [OperationContract]
        ParkDTO ReadParkById(int id);

        [OperationContract]
        ParkDTO CreatePark();

        [OperationContract]
        void RemovePark(int id);

        [OperationContract]
        void SavePark(ParkDTO park);

        [OperationContract]
        List<CarDTO> CarsInPark(int id);

        //PrivilegeLevel
        [OperationContract]
        List<PrivilegeLevelDTO> ReadAllPrivilegeLevels();

        [OperationContract]
        PrivilegeLevelDTO ReadPrivilegeLevelById(int id);

        [OperationContract]
        PrivilegeLevelDTO CreatePrivilegeLevel();

        [OperationContract]
        void RemovePrivilegeLevel(int id);

        [OperationContract]
        void SavePrivilegeLevel(PrivilegeLevelDTO privilegeLevel);

        //User
        [OperationContract]
        List<UserDTO> ReadAllUsers();

        [OperationContract]
        UserDTO ReadUserById(int id);

        [OperationContract]
        UserDTO CreateUser();

        [OperationContract]
        void RemoveUser(int id);

        [OperationContract]
        void SaveUser(UserDTO user);

        [OperationContract]
        bool ValidateUser(string username, string password);
    }

}